package com.stu.controller.student;

import com.stu.Dto.StuPasswordDto;
import com.stu.result.Result;
import com.stu.serive.StuPasswordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/student")
public class StuPasswordController {

    @Autowired
    private StuPasswordService stuPasswordService;

    @PutMapping("/passwordAlter")
    private Result StuPasswordAlter(@RequestBody StuPasswordDto stuPasswordDto){
        log.info("开始修改密码：{}",stuPasswordDto);
        stuPasswordService.StuPasswordAlter(stuPasswordDto);
        log.info("学生密码修改成功");
        return Result.success();
    }
}
